﻿<%if not in_sdcms then response.write("template load fail"):response.end() end if%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="{sdcms[seokey]}" />
<meta name="Description" content="{sdcms[seodesc]}" />
<title>{sdcms[webname]}</title>
<link href="{webroot}lib/css/base.css" rel="stylesheet" type="text/css" />
<link href="{webroot}theme/default/css/public.css" rel="stylesheet" type="text/css" />
<link href="{webroot}theme/default/css/user_base.css" rel="stylesheet" type="text/css" />
<link href="{webroot}theme/default/css/user.css" rel="stylesheet" type="text/css" />
<script>var webroot="{webroot}";</script>
<script src="{webroot}lib/js/jquery.js"></script>
<script src="{webroot}lib/js/jquery-migrate-1.1.0.min.js"></script>
<script src="{webroot}lib/tips/jquery.tips.js"></script>
<script src="{webroot}lib/js/base.js"></script>
{if sdcms[sys_mobile]}<script src="{webroot}lib/js/mobile.js"></script>{/if}
<script src="{webroot}lib/validator/jquery.validator.js"></script>
<script src="{webroot}lib/validator/zh_CN.js"></script>
<script src="{webroot}theme/default/js/sdcms.js"></script>
<script src="{webroot}lib/dialog/artdialog.js"></script>
<script>
$(function(){
	$("#user_menu_02").addClass("hover");
});
function checkdb(the)
{
	if($.trim(the.t0.value)=="")
	{
		$.fn.tips({content:"\u8bf7\u8f93\u5165\u5145\u503c\u91d1\u989d"});
		the.t0.focus();
		return false
	}
	if(!numOnly(the.t0.value))
	{
		$.fn.tips({content:"\u8bf7\u6b63\u786e\u8f93\u5165\u5145\u503c\u91d1\u989d"});
		the.t0.focus();
		return false
	}
	if(the.t0.value<=0)
	{
		$.fn.tips({content:"\u6700\u4f4e\u5145\u503c\u91d1\u989d\u4e3a\u0031\u5143"});
		the.t0.focus();
		return false
	}
	var d1="";
	for(i=0;i<the.t1.length;i++)
	{
		if(the.t1[i].checked)
		{
			d1=the.t1[i].value;
		}
	}
	if(d1=="")
	{
		$.fn.tips({content:"\u8bf7\u9009\u62e9\u652f\u4ed8\u63a5\u53e3"});
		return false
	}
	
	var paykey,payway;
	var arr=d1.split(":");
	paykey=arr[0];
	payway=arr[1];
	var html='<ul id="onlinetip">';
		html+='<dd>\u8bf7\u60a8\u5728\u65b0\u6253\u5f00\u7684\u7f51\u4e0a\u94f6\u884c\u9875\u9762\u4e0a\u5b8c\u6210\u5145\u503c</dd>';
		html+='<li>\u5145\u503c\u91d1\u989d\uff1a<span>'+the.t0.value+'</span>元</li>';
		html+='<li>\u652f\u4ed8\u65b9\u5f0f\uff1a<span>'+payway+'</span></li>';
		html+='</ul>';
	dialog({title:"\u652f\u4ed8\u63d0\u793a",content:html,button:[{value:'\u5df2\u5b8c\u6210\u5145\u503c',callback:function(){location.href='money.asp'},autofocus:true},{value:'\u91cd\u65b0\u64cd\u4f5c',callback:function(){location.href='pay.asp'}}]}).showModal();
	var url='?act=db&t0='+encodeURIComponent($.trim(the.t0.value))+'&t1='+encodeURIComponent(paykey)+'&t2='+encodeURIComponent(payway)+'';
	window.open(url);
	return false
}
</script>
</head>
<body>
    {sdcms:include("../sdcms_head.asp")}
    
    <div id="position">您所在的位置：<a href="{webroot}">首页</a> > <a href="./">会员中心</a></div>
    <div class="w980 mt10 mc">
        {sdcms:include("sdcms_menu.asp")}
        <div class="right_big">
            <div class="b">
                <div class="subject">在线充值</div>
                <div class="p35">
                
                {dim userdata:userdata=sdcms.userinfo}
                <form onsubmit="return checkdb(this)">
                <ul id="onlinepay">
                    {sdcms:rs field="amount" table="sd_user" where="id=[userdata(0)]"}
                    <li>可用余额：<span>{sdcms.getnum($rs[amount])}</span> 元</li>
                    {/sdcms:rs}
                    <li>充值金额：<input type="text" name="t0" class="ip" maxlength="10" /> 元　最低充值金额为<span> 1.00 </span>元</li>
                    <li>支付接口：<input type="hidden" name="t1" value="" />
                    {sdcms:rs field="setkey,setvalue" table="sd_config" where="setname='sdcms.api.pay'"}
                    {dim arr:arr=split($rs[setkey],".")}
                    {dim setkey:setkey=arr(0)}
                    {dim setvalue:setvalue=eval($rs[setvalue])}
                    <input type="radio" name="t1" value="{setkey}:{setvalue(0)}" /><img src="../api/pay/{setkey}/images/logo.gif" align="absmiddle" />
                    {/sdcms:rs}
                    </li>
                    <dd><input type="submit" value="下一步" class="bnt_blue" /> <input type="button" value="取消" onclick="location.href='javascript:history.go(-1)'" class="bnt_blue" /></dd>
                </ul>
                </form>
                
                </div>
            </div>
        </div>
    </div>
    {sdcms:include("../sdcms_foot.asp")}